import React from 'react';
import {ErrorBoundary, TabBar} from '@/components';
import {useLocation} from 'umi';

function BasicLayout(props) {
  const location = useLocation();
  const paths = ['/', '/order', '/user'];

  return (
    <>
      <TabBar
        show={paths.includes(location.pathname)}
        pathname={location.pathname}
      />
      <ErrorBoundary>
        {props.children}
      </ErrorBoundary>
    </>
  );
}

export default BasicLayout;
